See how mongo-express project compares to other vendors in security performance
In mongo-express 1.0.2, /admin allows CSRF, as demonstrated by deletion of a Collection.
mongo-express is a web-based MongoDB admin interface, written with Node.js and express. 1: As mentioned in this issue: https://github.com/mongo-express/mongo-express/issues/577, when the content of a cell grows larger than supported size, clicking on a row will show full document unescaped, however this needs admin interaction on cell. 2: Data cells identified as media will be rendered as media, without being sanitized. Example of different renders: image, audio, video, etc. As an example of type 1 attack, an unauthorized user who only can send a large amount of data in a field of a document may use a payload with embedded javascript. This could send an export of a collection to the attacker without even an admin knowing. Other types of attacks such as dropping a database\collection are possible.
All versions of package mongo-express are vulnerable to Denial of Service (DoS) when exporting an empty collection as CSV, due to an unhandled exception, leading to a crash.
mongo-express before 1.0.0 offers support for certain advanced syntax but implements this in an unsafe way. NOTE: this may overlap CVE-2019-10769.
Impact
Remote code execution on the host machine by any authenticated user.
Proof Of Concept
Launching mongo-express on a Mac, pasting the following into the "create index" field will pop open the Mac calculator:
javascript this.constructor.constructor("return process")().mainModule.require('childprocess').execSync('/Applications/Calculator.app/Contents/MacOS/Calculator')
Patches Users should upgrade to version 0.54.0
Workarounds Is there a way for users to fix or remediate the vulnerability without upgrading?
For more information If you have any questions or comments about this advisory: Open an issue in example link to repo Email us at example email address
Thanks
@JLLeitschuh for finding and reporting this vulnerability
This vulnerability has been exploited in the wild.